﻿namespace Authentication.Core.Data
{
    using Authentication.Core.Configuration;
    using Authentication.Core.Data.DBConfig;
    using Authentication.Model.Model;
    using System.Data.Entity;
    public class AuthenticationEntities : DbContext
    {
        public AuthenticationEntities() : base(SystemConfiguration.ConnectionString) { }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            Database.SetInitializer<AuthenticationEntities>(null);
            base.OnModelCreating(modelBuilder);
            modelBuilder.Configurations.Add(new AccountConfiguration());//Account
            modelBuilder.Configurations.Add(new DictionaryConfiguration());//Dictionary
            modelBuilder.Configurations.Add(new ObjectConfiguration());//Object
            modelBuilder.Configurations.Add(new GroupRuleConfiguration());//GroupRule
            modelBuilder.Configurations.Add(new AccountRuleConfiguration());//AccountRule
            modelBuilder.Configurations.Add(new GroupConfiguration());//Group
            modelBuilder.Configurations.Add(new BranchConfiguration());
            modelBuilder.Configurations.Add(new DaoInfoConfiguration());
            modelBuilder.Configurations.Add(new AccountGroupCustomerConfiguration());
            modelBuilder.Configurations.Add(new ActionLogConfiguration());
            modelBuilder.Configurations.Add(new UserQuestionConfiguration());
            modelBuilder.Configurations.Add(new DepartmentSmeConfiguration());
            modelBuilder.Configurations.Add(new DateBusinessConfiguration());
            modelBuilder.Configurations.Add(new CreatDaoRequestConfiguration());
            modelBuilder.Configurations.Add(new ChangeDaoRequestConfiguration());
            modelBuilder.Configurations.Add(new ChangeDaoProductConfiguration());
            modelBuilder.Configurations.Add(new ChangeDaoCifConfiguration());
            modelBuilder.Configurations.Add(new ChangeDaoProductCheckedConfiguration());
            modelBuilder.Configurations.Add(new CloseDaoRequestConfiguration());
            modelBuilder.Configurations.Add(new CustomerConfiguration());
            modelBuilder.Configurations.Add(new DaoCodeS16Configuration());
            modelBuilder.Configurations.Add(new EditDaoRequestConfiguration());
            modelBuilder.Configurations.Add(new EditDaoRequestDetailConfiguration());
        }
        public DbSet<ApplicationAccountRule> AccountRules { get; set; }
        public DbSet<Dictionary> Dictionaries { get; set; }
        public DbSet<Account> Accounts { get; set; }
        public DbSet<Branch> Branchs { get; set; }
        public DbSet<DepartmentSme> DepartmentSmes { get; set; }
        public DbSet<DaoInfo> DaoInfos { get; set; }
        public DbSet<AccountGroupCustomer> AccountGroupCustomers { get; set; }
        public DbSet<ApplicationGroupRule> GroupRules { get; set; }
        public DbSet<ApplicationObject> Objects { get; set; }
        public DbSet<ApplicationGroup> Groups { get; set; }
        public DbSet<ActionLog> ActionLogs { get; set; }
        public DbSet<UserQuestion> UserQuestions { get; set; }
        public DbSet<CreateDaoRequest> CreateDaoRequests { get; set; }
        public DbSet<ChangeDaoRequest> ChangeDaoRequests { get; set; }
        public DbSet<ChangeDaoCif> ChangeDaoCifs { get; set; }
        public DbSet<CloseDaoRequest> CloseDaoRequests { get; set; }
        public DbSet<ChangeDaoProduct> ChangeDaoProducts { get; set; }
        public DbSet<Customers> Customers { get; set; }
        public DbSet<ChangeDaoProductChecked> ChangeDaoProductCheckeds { get; set; }
        public DbSet<DateBusiness> DateBusinesses { get; set; }
        public DbSet<DaoCodeS16> DaoCodeS16s { get; set; }
        public DbSet<EditDaoRequest> EditDaoRequests { get; set; }
        public DbSet<EditDaoRequestDetail> EditDaoRequestDetails { get; set; }
    }
}
